<!-- 增加角色组件 -->
<template>
	<div id="addrole">
		<el-dialog title="添加角色菜单" :visible.sync="dialogFormVisible" append-to-body>
			<el-form :model="form" size="mini">
				<el-form-item label="角色名字	" :label-width="formLabelWidth">
					<el-input v-model="form.rolename" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="描述" :label-width="formLabelWidth">
					<el-input v-model="form.description" autocomplete="off"></el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="add">添 加</el-button>
			</div>
		</el-dialog>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				dialogFormVisible: this.isvisble,
				form: {
					rolename: "",
					description: ""
				},
				formLabelWidth: '120px'
			};
		},
		props: ["isvisble"],
		methods: {
			sdfghjk(s) {
				this.dialogFormVisible = s;
			},
			add() {
				
				let that=this;
				console.log(JSON.stringify(that.form));
				this.axios.post("http://localhost:8080/role/addEntity",that.form).then((res) => {
					alert(res.data.message);
					this.$parent.$parent.$parent.$parent.chaxun(1);
				}).catch(err => {
					console.log(err)
				})
				this.dialogFormVisible = false;
			}
		}
	};
</script>

<style scoped>
</style>